﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TfsExtensions.Build.Activities.Entities
{
    public struct AssemblyApplicationSettings
    {
        public bool IsAssemblyMetadataSelected { get; set; }
        public string ApplicationName { get; set; }
        public string ApplicationDescription { get; set; }
        public string CompanyName { get; set; }

        public override string ToString()
        {
            var strMetadata = string.Empty;
            if (this.IsAssemblyMetadataSelected)
            {
                var objMetadata = new StringBuilder();
                if (!string.IsNullOrEmpty(this.ApplicationName))
                {
                    objMetadata.Append(string.Format("Application Name: {0} ", this.ApplicationName));
                }

                if (!string.IsNullOrEmpty(this.CompanyName))
                {
                    objMetadata.Append(Environment.NewLine);
                    objMetadata.Append(string.Format("Company Name: {0} ", this.CompanyName));
                }

                if (!string.IsNullOrEmpty(this.ApplicationDescription))
                {
                    objMetadata.Append(Environment.NewLine);
                    objMetadata.Append(string.Format("Application Description: {0} ", this.ApplicationDescription));
                }

                strMetadata = objMetadata.ToString();
            }

            return strMetadata;
        }
    }
}
